<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Axios的使用</title>
    <script src="../vue.js"></script>
    <script src="../axios.min.js"></script> 
    <style>
        .mydiv{
            width: 300px;
            height: 300px;
            border: 1px solid grey;
            border-radius: 30px;
            float: left;
            margin: 20px;
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="loadData">加载数据</button>
        <div>
            <div v-for="item in array" class="mydiv">
                <h3>{{item.title}}</h3>
                <span>{{item.tname}}</span><br>
                <span>{{item.intro}}</span>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            array:[]
        },
        methods:{
            loadData:function(){
                var url="http://route.showapi.com/90-87?showapi_appid=45300&showapi_sign=c28de9d6f79e44369a9abcd40fa3e277";
                axios.get(url).then(res=>{
                   this.array=res.data.showapi_res_body.pagebean.contentlist;
                });
            }
        }
    });
</script>